package com.aurora.jzoffer;

import java.util.Stack;

/**
 * @author Aurora
 * createTime 2022.12.01 17:37:20
 * @className JZ9TwoStackForQueue.java
 */
public class JZ9TwoStackForQueue {
    Stack<Integer> stack1 = new Stack<Integer>();
    Stack<Integer> stack2 = new Stack<Integer>();
//原题答题格式
    public void push(int node) {
        stack1.push(node);
    }

    public int pop() {
        while(!stack1.empty()){
            stack2.push(stack1.pop());
        }
        return  stack2.pop();
    }



}
